The present disclosure relates to a communication device, a communication method and a computer readable medium storing instructions that are capable of measuring an available bandwidth while data communication is performed.
In public networks, such as the Internet, it is necessary to transmit and receive data at a transmission rate that is appropriate for an available bandwidth, which is the maximum bandwidth that can be used for data communication between communication devices. In this type of network, the available bandwidth varies depending on a region, a provider, a time zone, and other situations.
The following type of measurement method is known in order to measure the varying available bandwidth while transmitting and receiving media data, such as audio data. A transmission-side communication device sets a search range, which is a bandwidth range that becomes a measurement target. Next, the transmission-side communication device sequentially transmits a plurality of packets to measure the bandwidth in the set search range while changing a transmission interval. A difference between the transmission interval of the packets and a reception interval is calculated. The transmission interval is calculated from time information in the packets and the reception interval is recorded by a receiving-side communication device. The most recent available bandwidth is measured from a change tendency of the calculated plurality of difference values. When one cycle of bandwidth measurement is completed, a next search range is set based on a past measurement result and the next measurement processing is performed.
With the above-described measurement method, the search range is set centering on a reference point that indicates the most recent measurement result, and the bandwidth to transmit packets is selected from the set search range. The transmission-side communication device needs to transmit packets in a wider bandwidth than the most recent measurement result. A wide bandwidth is used for data communication and network load increases. Therefore, the receiving-side communication device may not be able to receive media data properly.
Various exemplary embodiments of the general principles herein provide a communication device, a communication method and a computer program that are capable of measuring an available bandwidth while transmitting media data properly.
The exemplary embodiments provide a communication device that measures an available bandwidth, which is a bandwidth that can be used for data communication, while changing a transmission rate of packets, the communication device comprising: a range setting portion that, based on a bandwidth measurement result, sets a reference point indicating a bandwidth value to be used as a reference for a next bandwidth measurement, and sets a search range, which is a bandwidth range that becomes a measurement target, centering on the reference point; a bandwidth setting portion that sets a bandwidth which has not been measured and which is included in the search range, as a measurement bandwidth which is a measurement target bandwidth; a first generation portion that generates media data at a constant interval, at a first generation rate that is lower than the reference point; a second generation portion that, in a case where the measurement bandwidth set by the bandwidth setting portion is higher than the first generation rate, generates redundant data that is capable of complementing the media data generated by the first generation portion, at a second generation rate corresponding to not more than a difference between the measurement bandwidth and the first generation rate; a packet generation portion that packetizes the media data generated by the first generation portion and the redundant data generated by the second generation portion, and thereby generates measurement packets; and a packet transmission portion that transmits the measurement packets generated by the packet generation portion to the measurement bandwidth set by the bandwidth setting portion.
The exemplary embodiments also provide a communication method that is performed by a communication device that measures an available bandwidth, which is a bandwidth that can be used for data communication, while changing a transmission rate of packets, the communication method comprising the steps of: setting, based on a bandwidth measurement result, a reference point indicating a bandwidth value to be used as a reference for a next bandwidth measurement, and determining a search range, which is a bandwidth range that becomes a measurement target, centering on the reference point; setting a bandwidth which has not been measured and which is included in the search range, as a measurement bandwidth which is a measurement target bandwidth; generating media data at a constant interval, at a first generation rate that is lower than the reference point; generating, in a case where the set measurement bandwidth is higher than the first generation rate, redundant data that is capable of complementing the generated media data, at a second generation rate corresponding to not more than a difference between the measurement bandwidth and the first generation rate; packetizing the generated media data and the generated redundant data, and thereby generating measurement packets; and transmitting the generated measurement packets to the set measurement bandwidth.
The exemplary embodiments also provide a computer program product stored on a non-transitory computer-readable medium, comprising instructions for causing a computer of a communication device that measures an available bandwidth, which is a bandwidth that can be used for data communication, while changing a transmission rate of packets to execute the steps of: setting, based on a bandwidth measurement result, a reference point indicating a bandwidth value to be used as a reference for a next bandwidth measurement, and determining a search range, which is a bandwidth range that becomes a measurement target, centering on the reference point; setting a bandwidth which has not been measured and which is included in the search range, as a measurement bandwidth which is a measurement target bandwidth; generating media data at a constant interval, at a first generation rate that is lower than the reference point; generating, in a case where the set measurement bandwidth is higher than the first generation rate, redundant data that is capable of complementing the generated media data, at a second generation rate corresponding to not more than a difference between the measurement bandwidth and the first generation rate; packetizing the generated media data and the generated redundant data, and thereby generating measurement packets; and transmitting the generated measurement packets to the set measurement bandwidth.